﻿<BaseControl:DataControl x:Class="jSLApp.Client.Forms.ArticleDetail"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:BaseControl="clr-namespace:jSLCore.Client.Presentation.BaseControl;assembly=jSLCore.Client.Presentation" xmlns:Controls="clr-namespace:jSLCore.Client.Presentation.Controls;assembly=jSLCore.Client.Presentation" xmlns:Controls1="clr-namespace:jSLApp.Client.Controls" xmlns:tk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" xmlns:Forms="clr-namespace:jSLApp.Client.Forms" xmlns:jBinding="clr-namespace:jSLCore.Client.Presentation.jBinding;assembly=jSLCore.Client.Presentation" xmlns:Converters="clr-namespace:jSLApp.Client.Converters" xmlns:Security="clr-namespace:jSLApp.Client.Security" mc:Ignorable="d"
                         
    d:DesignHeight="300" d:DesignWidth="400">
    <Controls:ImageGroupBox Header="текст">
        <tk:DockPanel LastChildFill="True">
            <Grid tk:DockPanel.Dock="Top">               
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Image Width="56" Height="56" Stretch="Fill" Grid.Column="0" VerticalAlignment="Top">
                        <Image.Source>
                            <jBinding:jBinding Path="ImageBs" ConvertingMode="BinaryToImage"/>
                        </Image.Source>
                    </Image>
                    <StackPanel Orientation="Vertical" Grid.Column="1">
                        <TextBlock FontWeight="Bold" FontSize="14" Text="{Binding Header}"/>                        
                        <StackPanel Orientation="Horizontal">
                            <Controls:LeftHeaderContainer Header="Автор:" ShareGroupName="1">
                                <TextBlock Text="{Binding CreatorNameText}"/>
                            </Controls:LeftHeaderContainer>
                            <Controls:LeftHeaderContainer Header="Дата публикации:" ShareGroupName="2">
                                <TextBlock>
                                    	<TextBlock.Text>
                                    		<jBinding:jBinding Path="CreationDate" ConvertingMode="ToShortDate" />
                                    	</TextBlock.Text>
                                </TextBlock>
                            </Controls:LeftHeaderContainer>
                            <Controls:LeftHeaderContainer Header="Тип:" ShareGroupName="3">
                                <TextBlock>
                                        <TextBlock.Text>
                                            <jBinding:EnumBinding Path="TypeEnum"/>
                                        </TextBlock.Text>
                                </TextBlock>
                            </Controls:LeftHeaderContainer>                        
                    </StackPanel>
                    <Controls:LeftHeaderContainer Header="Постоянная ссылка:">
                        <HyperlinkButton ToolTipService.ToolTip="Скопировать в буфер обмена" Click="copyLink_Clicked">
                            <HyperlinkButton.Content>
                                <Binding Path="id">
                                    <Binding.Converter>
                                        <Converters:ArticleIdToWebLinkConverter/>
                                    </Binding.Converter>
                                </Binding>
                            </HyperlinkButton.Content>
                        </HyperlinkButton>
                    </Controls:LeftHeaderContainer>
                    <Controls:ImageButton Content="Удалить" Image="../Resources/delete.png" Click="deleteIt">
                        <BaseControl:BaseControl.jBinding>
                            <Security:SecurityBinding Permission="Users"/>
                        </BaseControl:BaseControl.jBinding>
                    </Controls:ImageButton>
                    <Forms:SubscriptionToIt x:Name="subs"/>
                </StackPanel>
            </Grid>        
                <tk:DockPanel>                    
                    <tk:Expander IsExpanded="False" Header="Комментарии" tk:DockPanel.Dock="Bottom" ExpandDirection="Down">
                        <Forms:CommentList x:Name="commentList" DataUpdated="updateData" IsRatingVisible="False">
                    
                        </Forms:CommentList>
                    </tk:Expander>
                    <Controls1:jSLBrowser x:Name="browser"/>
                </tk:DockPanel>
        </tk:DockPanel>        
    </Controls:ImageGroupBox>
</BaseControl:DataControl>
